package com.zhuang.chapter10.work03;

import java.util.Scanner;

public class CountString {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner input = new Scanner(System.in);
		System.out.println("请输入一串字符串");
		int countUpper = 0;
		int countLower = 0;
		int numberDigit = 0;
		String string = input.nextLine();
		for (char ch : string.toCharArray()) {
			if (Character.isUpperCase(ch)) {
				countUpper++;
			} else if (Character.isLowerCase(ch)) {
				countLower++;
			} else if (Character.isDigit(ch)) {
				numberDigit++;
			}
		}
		System.out.println("大写字母出现的次数：" + countUpper);
		System.out.println("小写字母出现的次数：" + countLower);
		System.out.println("数字出现的次数：" + numberDigit);
	}

}
